package com.fanyue.modules.wzb.schedule;

import com.fanyue.modules.wzb.service.AppUserFaceRecordService;
import lombok.AllArgsConstructor;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Configuration      //1.主要用于标记配置类，兼备Component的效果。
@EnableScheduling   // 2.开启定时任务//部署到正式环境时取消注释
@AllArgsConstructor
public class SqtScheduleTask implements CommandLineRunner {

	private final AppUserFaceRecordService appUserFaceRecordService;

    //3.添加定时任务
	@Scheduled(cron = "0 * * * * ?")
    private void configureTasks() {
        appUserFaceRecordService.scheduledTask();
    }

    @Override
    public void run(String... args) throws Exception {
        //orderService.cs("bbbb");
    }
}
